package com.demo.my.Service;

import com.demo.my.Dao.PositionDao;
import com.demo.my.Entity.Position;

import java.sql.SQLException;
import java.util.List;

public class PositionService {
    private PositionDao positionDao=new PositionDao();
    public List<Position> getPositionList() throws Exception {
        return positionDao.getPositionList();
    }

    public void addPosition(Position position) throws Exception {
        positionDao.addPosition(position);
    }

    public Position getPositionByid(String id) throws Exception {
        return positionDao.getPositionByid(id);
    }

    public void updatePosition(Position position) throws Exception {
        positionDao.updatePosition(position);
    }

    public void deleteByid(String id) throws Exception {
        positionDao.deleteByid(id);
    }
    public Position getPositionByNumber(int positionNumber) throws Exception {
        return positionDao.getPositionByNumber(positionNumber);
    }

    public int getMaxNumber() throws SQLException {
        return positionDao.getMaxNumber();
    }
}
